package com.muyu.user.domain.model;

import com.muyu.user.domain.req.SysUserTagEditReq;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;
import lombok.experimental.SuperBuilder;

/**
 * 用户标签修改请求对象
 *
 * @author liuguoqiang
 * @date 2025-09-14
 */
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "用户标签修改请求对象")
public class SysUserTagEditModel {

    /**
     * 标签ID
     */
    @Schema(name = "tagId", title = "标签ID", description = "标签ID" )
    private Long tagId;

    /**
     * 标签名称
     */
    @Schema(name = "tagName", title = "标签名称", description = "标签名称" , required = true)
    private String tagName;

    /**
     * 标签编码
     */
    @Schema(name = "tagCode", title = "标签编码", description = "标签编码" , required = true)
    private String tagCode;

    /**
     * 标签颜色
     */
    @Schema(name = "tagColor", title = "标签颜色", description = "标签颜色" )
    private String tagColor;

    /**
     * 标签描述
     */
    @Schema(name = "description", title = "标签描述", description = "标签描述" )
    private String description;

    /**
     * 排序
     */
    @Schema(name = "sortOrder", title = "排序", description = "排序" )
    private Long sortOrder;

    /**
     * 状态（0正常 1停用）
     */
    @Schema(name = "status", title = "状态（0正常 1停用）", description = "状态（0正常 1停用）" )
    private String status;

    /**
     * 修改构造器
     */
    public static SysUserTagEditModel editReqBuild(Long tagId, SysUserTagEditReq sysUserTagEditReq){
        return SysUserTagEditModel.builder()
            .tagId(tagId)
            .tagId(sysUserTagEditReq.getTagId())
            .tagName(sysUserTagEditReq.getTagName())
            .tagCode(sysUserTagEditReq.getTagCode())
            .tagColor(sysUserTagEditReq.getTagColor())
            .description(sysUserTagEditReq.getDescription())
            .sortOrder(sysUserTagEditReq.getSortOrder())
            .status(sysUserTagEditReq.getStatus())
            .build();
    }

}
